home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / Expanders / GetFile.desc < prev    next >
Encoding:
Text File  |  1997-06-17  |  2.3 KB  |  107 lines

  1. ##SUPPORT
  2. struct Gadget *create_getfile_gad(struct Gadget *gadlist, void *vi,
  3.                                   struct GetFileGad *This_GFGad)
  4.  {
  5.  struct NewGadget ng;
  6.  
  7.  ng.ng_TextAttr     = NULL;
  8.  ng.ng_VisualInfo   = vi;
  9.  ng.ng_Flags        = 0;
  10.  ng.ng_UserData     = This_GFGad->HitFunc;
  11.  ng.ng_LeftEdge     = This_GFGad->Left;
  12.  ng.ng_Width        = 21;
  13.  ng.ng_Height       = 14;
  14.  ng.ng_GadgetText   = "";
  15.  ng.ng_TopEdge      = This_GFGad->Top;
  16.  ng.ng_GadgetID     = This_GFGad->ID;
  17.  
  18.  This_GFGad->the_gad = gadlist= CreateGadget(GENERIC_KIND, gadlist, &ng,
  19.                                 TAG_END);
  20.  
  21. This_GFGad->the_gad->Flags             |= GFLG_GADGIMAGE | GFLG_GADGHCOMP;
  22. This_GFGad->the_gad->Activation        |= GACT_RELVERIFY;
  23. This_GFGad->the_gad->GadgetRender       = (APTR)&GetFileImage;
  24. This_GFGad->the_gad->SelectRender       = NULL;
  25.  
  26. if(this_gad->Disabled)This_GFGad->the_gad->Flags   |= GFLG_DISABLED;
  27.  
  28. return(gadlist);
  29. }
  30.  
  31.  
  32. ##HEADER
  33.  
  34. struct GetFileGad
  35.     {
  36.     int Left, Top, ID;
  37.     BOOL Diabled,
  38.     APTR HitFunc,
  39.     struct Gadget *the_gad        /*Allows you to OnGadget/OffGadget the gad!*/
  40.     };
  41.  
  42. struct Image GF_NormImage =
  43. {
  44.    0,0,                 /* X, Y */
  45.    20, 14, 2,           /* Width, Height, Depth */
  46.    &GF_NormImagedata[0],        /* Image Data*/
  47.    3, 0,                /* PlanePick, PlaneOnOff */
  48.    NULL                 /* Next Image Structure*/
  49. };
  50.  
  51.  
  52. extern struct Gadget *create_getfile_gad( struct Gadget * ,void, struct GetFileGad *);
  53.  
  54. ##EXTERN
  55. extern BOOL %oClicked( struct Window *, struct Gadget *, struct IE_Data *, struct IntuiMessage *)
  56. extern struct GetFileGad %oGF;
  57.  
  58. ##OPENWND
  59. g=create_getfile_gad(g,(IE->ScreenData->Visual),%oGF);
  60.  
  61. ##DATA
  62.  
  63. struct GetFileGad %oGF
  64.     {
  65.     %x, %y, %i,
  66.     %d,
  67.     %oClicked,
  68.     NULL
  69.     };
  70.  
  71. ##CHIP
  72. __chip USHORT GF_NormImagedata[] =
  73. {
  74.    0x0000, 0x1000,
  75.    0x0000, 0x3000,
  76.    0x003C, 0x3000,
  77.    0x0042, 0x3000,
  78.    0x0F81, 0x3000,
  79.    0x0FC1, 0x3000,
  80.    0x0C3F, 0x3000,
  81.    0x0C01, 0x3000,
  82.    0x0C01, 0x3000,
  83.    0x0C01, 0x3000,
  84.    0x0FFF, 0x3000,
  85.    0x0000, 0x3000,
  86.    0x0000, 0x3000,
  87.    0x7FFF, 0xF000,
  88.  
  89.    0xFFFF, 0xE000,
  90.    0xC000, 0x0000,
  91.    0xC000, 0x0000,
  92.    0xC000, 0x0000,
  93.    0xC000, 0x0000,
  94.    0xC000, 0x0000,
  95.    0xC000, 0x0000,
  96.    0xC000, 0x0000,
  97.    0xC000, 0x0000,
  98.    0xC000, 0x0000,
  99.    0xC000, 0x0000,
  100.    0xC000, 0x0000,
  101.    0xC000, 0x0000,
  102.    0x8000, 0x0000,
  103.  
  104.    };
  105.  
  106. ##end
  107.